from django.db import models
from app.models import BaseModel
# Create your models here.


class ThinkingModel(BaseModel):
    """
    思维模型表
    """
    name = models.CharField(
        max_length=20, verbose_name='思维模型名称', db_comment='思维模型名称')
    enhanced_name = models.CharField(
        max_length=100, null=True, blank=True, verbose_name='增强名称', db_comment='增强名称')
    category = models.CharField(
        max_length=20, null=True, blank=True, verbose_name='模型分类', db_comment='模型分类')
    proposer = models.CharField(
        max_length=20, null=True, blank=True, verbose_name='提出者', db_comment='提出者')
    proposal_time = models.DateField(
        null=True, blank=True, verbose_name='提出时间', db_comment='提出时间')
    description = models.TextField(
        null=True, blank=True, verbose_name='模型描述', db_comment='模型描述')
    usage = models.TextField(
        null=True, blank=True, verbose_name='模型使用', db_comment='模型使用')
    baidu_baike_url = models.URLField(
        null=True, blank=True, verbose_name='百度百科URL', db_comment='百度百科URL')

    def __str__(self):
        return self.name or '无模型'

    class Meta:
        db_table = 'cross_subject_thinking_model'
        verbose_name = '思维模型'
        verbose_name_plural = '01.思维模型'
        db_table_comment = '思维模型表'


class ThinkingModelCase(BaseModel):
    """
    思维模型案例表
    """
    name = models.CharField(
        max_length=255, verbose_name='思维模型案例名称', db_comment='思维模型案例名称')
    model_id = models.CharField(
        max_length=20,
        null=True,
        blank=True,
        verbose_name='思维模型ID',
        db_comment='思维模型ID',
    )
    case = models.TextField(
        null=True, blank=True, verbose_name='模型案例描述', db_comment='模型案例描述')
    summary = models.TextField(
        null=True, blank=True, verbose_name='模型案例总结', db_comment='模型案例总结')

    def __str__(self):
        return self.name or '无模型案例'

    class Meta:
        db_table = 'cross_subject_thinking_model_case'
        verbose_name = '思维模型案例'
        verbose_name_plural = '02.思维模型案例'
        db_table_comment = '思维模型案例表'
